from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.common.exceptions import NoSuchElementException
from selenium.webdriver.common.keys import Keys
import unittest, time, re, csv, logging, datetime
import ConfigParser

class globalflag:
    # =========================== Start: Global Flag ===========================
    # Created by: Giovanni Minoza
    # Date Created: August 15, 2013
    # Purpose: Used for checking global flag
    # =========================== Start: Global Flag ===========================
    global flagtocontinue, chbv, chb2v, precedaversion, precedaactivity, precedacountry, tsdr
    # =========================== End: Global Flag ===========================

#class globalvar:
    # =========================== Start: Global Variables ===========================
    # Created by: Giovanni Minoza
    # Date Created: August 29, 2013
    # Purpose: Used for global variables assignments
    # =========================== Start: Global Variables ===========================
    #ifile  = open('test.csv', "rb")
    #reader = csv.reader(ifile)
    #rownum = 0
    #for row in reader:
    #    if rownum == 0:
    #        header = row
    #    else:
    #        colnum = 0
    #        for col in row:
    #            print '%-8s: %s' % (header[colnum], col)
    #            colnum += 1
    #    rownum += 1
    #ifile.close()
    # =========================== End: Global Variables ===========================

class globalini:
    config = ConfigParser.SafeConfigParser()
    config.read('preceda.ini')
    now = datetime.datetime.now()
    browsers = config.getint('parameters', 'browsers') #0=IE, 1=Chrome, 2=Firefox, 3=All
    displayalerts = config.getint('parameters', 'displayalerts') #0=no alerts, 1=with alerts
    closeonend = config.getint('parameters', 'closeonend') #0=don't close, 1=close
    writetocsv = config.getint('parameters', 'writetocsv') #no, 1=yes
    cntr = config.getint('parameters', 'cntr')
    csvpath = config.get('parameters', 'csvpath')
    csvscripts = config.get('parameters', 'csvscripts')
    joblog = config.get('parameters', 'joblog')
    screenoutput = config.get('parameters', 'screenoutput')
    start_date = datetime.datetime.now().date()
    start_time = datetime.datetime.now().time()

    
